#pragma once
#include <QString>
#include "ObjectPrefab.h"
class PrefabRepository : public QObject
{
	Q_OBJECT

private:
	PrefabRepository(void);
	~PrefabRepository(void);
public:
	static PrefabRepository* Instance();
	//todo:
	void AddPrefab(ObjectPrefab* prefab)
	{
		prefabs_.insert(prefab->Guid(), prefab);
		PrefabAdded(prefab);
	}
	ObjectPrefab* LookupPrefab(QString guid)
	{
		return prefabs_[guid];
	}
signals:
	void PrefabAdded(ObjectPrefab* prefab);
private:
	QMap<QString, ObjectPrefab*> prefabs_;
	static PrefabRepository* instance_;
};
